#include <stdio.h>
#include <string.h>

void reverse(char *str)
{
    int len = strlen(str);
    int l = 0, r = len - 1;
    while (l < r)
    {
        char tmp = *(str + l);
        *(str + l) = *(str + r);
        *(str + r) = tmp;
        l++;
        r--;
    }
}

int main()
{
    char arr[] = "ancdefg";
    reverse(arr);
    printf("%s\n", arr);
    return 0;
}